home *** CD-ROM | disk | FTP | other *** search
- (*************************************************************************
-
- $RCSfile: DisplayAlert.mod $
- Description: A port of displayalert.c from the RKM:Libraries
-
- This program implements a recoverable alert.
-
- Created by: fjc (Frank Copeland)
- $Revision: 1.4 $
- $Author: fjc $
- $Date: 1995/01/25 23:52:19 $
-
- Copyright © 1994, Frank Copeland.
- This example program is part of Oberon-A.
- See Oberon-A.doc for conditions of use and distribution.
-
- *************************************************************************)
-
- <* STANDARD- *>
-
- MODULE DisplayAlert;
-
- IMPORT d := Dos, i := Intuition;
-
- CONST
- VersionTag = "$VER: DisplayAlert 1.2 (19.9.94)\r\n";
-
- (* Each string requires its own positioning information, as explained
- ** in the manual. Hex notation has been used to specify the positions of
- ** the text. Hex numbers start with a backslash, an "x" and the characters
- ** that make up the number.
- **
- ** Each line needs 2 bytes of X position, and 1 byte of Y position.
- ** In our 1st line: x - \x00\xF0 (2 bytes) and y = \x14 (1 byte)
- ** In our 2nd line: x - \x00\xA0 (2 bytes) and y = \x24 (1 byte)
- ** Each line is null terminated plus a continuation character (0=done).
- ** This example assumes that the compiler will concatenate adjacent
- ** strings into a single string with no extra NULLs. The compiler does
- ** add the terminating NULL at the end of the entire string...The entire
- ** alert must end in TWO NULLS, one for the end of the string, and one
- ** for the NULL continuation character.
- *)
-
- CONST
- alertMsg =
- "\x00\xF0\x14" "OH NO, NOT AGAIN!" "\x00\x01"
- "\x00\x80\x24" "PRESS MOUSEBUTTON: LEFT=TRUE RIGHT=FALSE" "\x00";
-
- BEGIN (* DisplayAlert *)
- IF i.DisplayAlert (i.recoveryAlert, alertMsg, 52) THEN
- d.PrintF ("Alert returned TRUE\n", NIL)
- ELSE
- d.PrintF ("Alert returned FALSE\n", NIL)
- END
- END DisplayAlert.
-